class Phone{
    constructor(brand,price){
        this.brand = brand;
        this.price = price;
    }
    call(){
        console.log('我可以打电话');
        
    }
}

class SmartPhone extends Phone{
    constructor(brand,price,color,size){
        super(brand,price);
        this.color = color;
        this.size = size;
    }

    photo(){
        console.log('我可以拍照');
        
    }
    playGame(){
        console.log('我可以打游戏');
        
    }
}

const xiaoMiPhone = new SmartPhone('xiaomi',2000,'黑色','505');
console.log(xiaoMiPhone);
